package com.yanxu;

import com.sun.corba.se.pept.transport.ByteBufferPool;

import java.nio.ByteBuffer;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2025/6/8-2025
 * @Description: 这里用一句话描述这个类的作用
 */
public class Test2 {
    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.allocate(1024);
        byteBuffer.putChar('a');
        byteBuffer.putChar('b');
        byteBuffer.putChar('c');
        byteBuffer.putInt(287);
        byteBuffer.putInt(300);

        byteBuffer.flip();
        //System.out.println(byteBuffer.get(1));
        System.out.println(byteBuffer.getChar());
        System.out.println(byteBuffer.getChar());
        byteBuffer.mark();
        System.out.println(byteBuffer.getChar());
        System.out.println(byteBuffer.getInt());
        System.out.println(byteBuffer.reset());
        System.out.println(byteBuffer.getChar());
    }
}